var gallery = {

    open:function( image_obj, fn ){
        CKFinder.modal( {
            width: 600,
            height: 400,
            chooseFiles: true,
            onInit: function( finder ) {
                finder.on( 'files:choose', function( evt ) {
                    console.log('files:choose');
                    var file = evt.data.files.first();
                    console.log(file.getUrl());
                    var url =  file.getUrl();
                    image_obj.url = url;

                    if( typeof fn == 'function' ){
                        fn();
                    }
                    // console.log( image_obj );
                    // t.setImage(image_obj, url  );
                } );
                // finder.on( 'file:choose:resizedImage', function( evt ) {
                //     console.log('files:choose:resizedImage');
                //     document.getElementById( 'url' ).value = evt.data.resizedUrl;
                // } );
            }
        } );
    }
};



export default gallery;